
package com.contractmodule.bean;

import com.contractmodule.dao.TbContractDAO;
import com.usersmodule.bean.TbUsers;
import com.usersmodule.dao.TbUsersDAO;

public class TbAccessories implements java.io.Serializable {

    private int accessoriesId;

    private String contractCode;
    private TbContract tbContract;
    private String accessoriesFileName;

    private int userId;
    private TbUsers tbUsers;
    private String createTime;

    public int getAccessoriesId(){
        return accessoriesId;
    }

    public void setAccessoriesId(int accessoriesId){
        this.accessoriesId = accessoriesId;
    }

    public String getContractCode(){
        return contractCode;
    }
    
    public TbContract getTbContract() {
		return tbContract;
	}

	public void setTbContract(TbContract tbContract) {
		this.tbContract = tbContract;
	}

	public void setContractCode(String contractCode){
        this.contractCode = contractCode;
        this.tbContract=new TbContractDAO().getTbContractByContractCode(contractCode);
    }

    public String getAccessoriesFileName(){
        return accessoriesFileName;
    }

    public void setAccessoriesFileName(String accessoriesFileName){
        this.accessoriesFileName = accessoriesFileName;
    }

    public int getUserId(){
        return userId;
    }

    public void setUserId(int userId){
        this.userId = userId;
        this.tbUsers=new TbUsersDAO().getTbUsersByUserId(userId);
    }
    
    public TbUsers getTbUsers() {
		return tbUsers;
	}

	public void setTbUsers(TbUsers tbUsers) {
		this.tbUsers = tbUsers;
	}

	public String getCreateTime(){
        return createTime;
    }

    public void setCreateTime(String createTime){
        this.createTime = createTime;
    }


    public TbAccessories(){
    }
    public TbAccessories(String contractCode,String accessoriesFileName,int userId){
        this.contractCode = contractCode;
        this.accessoriesFileName = accessoriesFileName;
        this.userId = userId;
    }
    public TbAccessories(int accessoriesId,String contractCode,String accessoriesFileName,int userId){
        this.accessoriesId = accessoriesId;
        this.contractCode = contractCode;
        this.accessoriesFileName = accessoriesFileName;
        this.userId = userId;
    }
}

